//
//  BHSearchBar.m
//  xinlangweibo0621
//
//  Created by boldseas on 2017/6/22.
//  Copyright © 2017年 renbohan. All rights reserved.
//  Discover导航栏上的搜索框

#import "BHSearchBar.h"

@implementation BHSearchBar

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    
    self.font = [UIFont systemFontOfSize:15];
    self.placeholder = @"请输入搜索条件...";
    self.background = [UIImage imageNamed:@"searchbar_textfield_background"];
    
    
    
    UIImageView *searchIcon = [[UIImageView alloc]init];
    searchIcon.image = [UIImage imageNamed:@"searchbar_textfield_search_icon"];
    CGRect searchIconF = searchIcon.frame;
    searchIconF.size = CGSizeMake(30, 30);
    searchIcon.frame = searchIconF;
    searchIcon.contentMode = UIViewContentModeCenter;
    self.leftView = searchIcon;
    self.leftViewMode = UITextFieldViewModeAlways;
    
    return self;
}

+(instancetype)searchBar{
    return [[self alloc]init];
}

@end
